package wnhz.com.business.shareshop.activity.mine;

import android.app.Application;
import android.content.Intent;
import android.os.Build;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.WindowManager;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import wnhz.com.business.R;
import wnhz.com.business.base.BaseRVAdapter;
import wnhz.com.business.base.BaseViewHolder;
import wnhz.com.business.base.MyBaseActivity;
import wnhz.com.business.impl.ActionBarClickListener;
import wnhz.com.business.view.TranslucentActionBar;

/**
 * 退款中
 */
public class RefundUnderwayActivity extends MyBaseActivity implements ActionBarClickListener {
    @BindView(R.id.actionbar)
    TranslucentActionBar actionbar;
    @BindView(R.id.rv_refund_underway_people)
    RecyclerView rvRefundUnderwayPeople;

    private List<String> itemdata = new ArrayList<>();

    @Override
    protected void handleMsg(Message msg) {

    }

    public static Intent createIntent(Application application) {
        Intent intent = new Intent(application, RefundUnderwayActivity.class);
        return intent;
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_refund_underway);
        ButterKnife.bind(this);
        actionbar.setData("退款中", R.drawable.ic_lefft_white, null, 0, "", 0, this);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            actionbar.setStatusBarHeight(getStatusBarHeight());
        }
        initview();
        initdatabus();
    }

    private void initview() {
        rvRefundUnderwayPeople.setLayoutManager(new LinearLayoutManager(getApplication(), LinearLayoutManager.VERTICAL, false));

        itemdata.clear();
        for (int i = 0; i < 3; i++) {
            itemdata.add("h" + i);
        }
    }

    private void initdatabus() {
        rvRefundUnderwayPeople.setAdapter(new BaseRVAdapter(this, itemdata) {
            @Override
            public int getLayoutId(int viewType) {
                return R.layout.item_rebate_friend;
            }

            @Override
            public void onBind(BaseViewHolder holder, int position) {

            }

            @Override
            public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

            }
        });
    }


    @Override
    public void onLeftClick() {
        finish();
    }

    @Override
    public void onRightClick() {

    }

    @Override
    public void onEditTextClick() {

    }
}
